package com.unlcn.ils.kas.api.scheduled;

import com.unlcn.ils.kas.service.constant.CronConstant;
import com.unlcn.ils.kas.service.order.GetTrackService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 江铃控股订单调度
 * 
 * @author 罗必量
 */
@Component
public class GetTrackScheduled {

    private static final Logger LOGGER = LoggerFactory.getLogger(GetTrackScheduled.class);

    @Autowired
    private GetTrackService getTrackService;

    /**
     * 获取在途信息 定时任务
     */
    // @Scheduled(cron = CronConstant.GET_TRACK_CRON)
    public void getTrack() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        LOGGER.info(simpleDateFormat.format(new Date()) + "拉取在途信息调度 start ====================");

        getTrackService.getTrack();

        LOGGER.info(simpleDateFormat.format(new Date()) + "拉取在途信息调度 end ====================");
    }
}
